package com.audi.view;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;


import com.audi.R;
import com.audi.adapter.SQLiteAsusNewHelper;
import com.audi.dto.PlaceItem;
import com.audi.utils.CapabilityHelper;
import com.audi.utils.Constants;
import com.audi.utils.DateUtil;
import com.audi.utils.SceneHelper;

public class InfoOfPlaceView extends LinearLayout {

	private LinearLayout mRlController;
	private TextView txtCountDeviceOfPlace, txtCapabilityOfPlace,
	txtDateCreated;

	public InfoOfPlaceView(Context context) {
		super(context);
		initLayout();
		// TODO Auto-generated constructor stub
	}

	public InfoOfPlaceView(Context context, AttributeSet attrs) {
		super(context, attrs);
		initLayout();
	}

	public InfoOfPlaceView(Context context, AttributeSet attrs, int defStyle) {
		super(context, attrs, defStyle);
		initLayout();
	}

	public void initLayout() {

		LayoutInflater.from(getContext()).inflate(R.layout.row_info_of_place,
				this);
		txtCountDeviceOfPlace = (TextView) this
				.findViewById(R.id.txt_NumberOfDevice);
		txtCapabilityOfPlace = (TextView) this
				.findViewById(R.id.txtTypeOfplace);
		txtDateCreated =(TextView) this.findViewById(R.id.txtAddTime);
		mRlController = (LinearLayout) this
				.findViewById(R.id.rlt_drag_info_of_place);

	}

	public void setData(PlaceItem _placeItem) {
		PlaceItem placeItem = _placeItem;
		txtCapabilityOfPlace.setText(CapabilityHelper.getCapabilityString(
				getContext(), placeItem.getCapabilityType()));
		txtCountDeviceOfPlace.setText(placeItem.getDeviceNumber()
				+ getContext().getResources().getString(R.string.devices));
		txtDateCreated.setText(placeItem.getDateCreated());
	}

}
